def merge_same_day(list1, list2):
    # 使用字典存储 date -> close 的映射，方便快速查找
    date_to_close1 = {item.date: item.close for item in list1}
    date_to_close2 = {item.date: item.close for item in list2}

    # 找出两个字典中都存在的 date（交集）
    common_dates = set(date_to_close1.keys()) & set(date_to_close2.keys())

    # 按 date 顺序提取对应的 close 值
    close_list1 = [float(date_to_close1[date]) for date in sorted(common_dates)]
    close_list2 = [float(date_to_close2[date]) for date in sorted(common_dates)]

    return close_list1, close_list2